<?php

class Admin_IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    	$this->_helper->acl->allow('admin');
    }
    public function indexAction()
    {
    	$message = $this->_helper->FlashMessenger->getMessages();
	    if($message){
	    	$this->view->message = $message[0];
	    }
		$this->view->title = 'Admin area';
    }
    public function successAction()
    {
    	if($this->_helper->getHelper('FlashMessenger')->getMessages()){
    		$this->view->messages = $this->_helper->getHelper('FlashMessenger')->getMessages();
    	}
    	else{
    		$this->_helper->redirector('index', 'index', 'admin');
    	}
    }
    public function failAction()
    {
    	if($this->_helper->getHelper('FlashMessenger')->getMessages()){
    		$this->view->messages = $this->_helper->getHelper('FlashMessenger')->getMessages();
    	}
    	else{
    		$this->_helper->redirector('index', 'index', 'admin');
    	}
    }    
    
}